#include<iostream>
#include "../source/public.h"

using namespace std;

framework::Logger::ptr g_logger = FRAMEWORK_LOG_ROOT();

void fun()
{
    cout << "run_in_fiber begin" << endl;
    framework::Fiber::YieldToHold();
    cout << "run_out_fiber end" << endl;
}

int main(void)
{
    framework::Thread::SetName("main");
    FRAMEWORK_LOG_INFO(g_logger) << "lalala";

    framework::Fiber::GetThis();
    cout << "main begin" << endl;
    framework::Fiber::ptr fiber(new framework::Fiber(fun));
    fiber->swapIn();
    cout << "main after swapIn" << endl;
    fiber->swapIn();
    cout << "main after end" << endl;
    
    return 0;
}

